<template>
	<view class="main">
		<view class="title">{{info.title}}</view>
		<view class="time">
			<!-- <image src="@/static/newCenter/time_img.png" class="time_img" mode=""></image> -->
			<text>{{info.time.substr(0,info.time.length-3)}}</text>
		</view>
		<view class="rich_box">
			<rich-text :nodes="info.content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nodes:'',
				info:{
					title:'',
					time:'',
					content:''
				},
			}
		},
		onLoad(option) {
			this.getDetail(option.id)
		},
		methods: {
			async getDetail(id) {
				uni.showLoading()
				// 获取文章详情
				try{
					var res = await this.$api.getAnnouncementGetInfo(id)
						uni.hideLoading()
						this.info = res.result
				}catch{
					uni.hideLoading()
				}finally {
					setTimeout(res => {
						uni.hideLoading()
					}, 4000)
				}
			},

		}
	}
</script>

<style>

	.main{
		padding:40rpx 0;
		box-sizing: border-box;
	}
	.title{
		width: 100%;
		font-weight: 400;
		font-size: 40rpx;
		line-height: 56rpx;
		letter-spacing: -0.4rpx;
		color: #222222;
		padding: 0 40rpx;
		box-sizing: border-box;
	}
	.time{
		width: 100%;
		padding: 22rpx 40rpx 40rpx 40rpx;
		font-weight: 400;
		font-size: 26rpx;
		line-height: 36rpx;
		color: #999999;
		border-bottom: 2rpx solid #D0D0D0;
		box-sizing: border-box;
	}
	.rich_box{
		padding: 38rpx 40rpx;
		color: #333333;
		box-sizing: border-box;
	}

</style>
